package com.budwk.app.sqfw.models;

import com.alibaba.fastjson.JSONObject;
import com.budwk.app.sqfwV2.dto.vo.HouseRelatPerson;
import com.budwk.starter.common.openapi.annotation.ApiModel;
import com.budwk.starter.common.openapi.annotation.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Data
@Accessors(chain = true)
@Table("shequ.sqfw_house_info")
@Comment("房屋信息")
@ApiModel(description = "房屋信息")
public class HouseInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Column
    @Name
    @Comment("编号")
    @ApiModelProperty(description = "ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @PrevInsert(els = {@EL("snowflake()")}, nullEffective = true)
    private String id;

    @Column("building_id")
    @Comment("楼栋id")
    @ApiModelProperty(description = "楼栋id")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String buildingId;

    @Column("province")
    @Comment("省份")
    @ApiModelProperty(description = "省份")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String province;

    @Column("city")
    @Comment("城市")
    @ApiModelProperty(description = "城市")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String city;

    @Column("district")
    @Comment("区")
    @ApiModelProperty(description = "区")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String district;

    @Column("county")
    @Comment("县")
    @ApiModelProperty(description = "县")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String county;

    @Column("community")
    @Comment("社区")
    @ApiModelProperty(description = "社区")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String community;

    @Column("courtyard")
    @Comment("院落")
    @ApiModelProperty(description = "院落")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String courtyard;

    @Column("house_number")
    @Comment("房屋号")
    @ApiModelProperty(description = "房屋号")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String houseNumber;

    @Column("grid")
    @Comment("网格")
    @ApiModelProperty(description = "网格")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String grid;

    @Column("door_number")
    @Comment("户门牌详址")
    @ApiModelProperty(description = "户门牌详址")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String doorNumber;

    @Column("unit")
    @Comment("单元")
    @ApiModelProperty(description = "单元")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String unit;

    @Column("floor")
    @Comment("楼层")
    @ApiModelProperty(description = "楼层")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String floor;

    @Column("room_number")
    @Comment("房号")
    @ApiModelProperty(description = "房号")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String roomNumber;

    @Column("is_loft")
    @Comment("是否是夹层")
    @ApiModelProperty(description = "是否是夹层")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String isLoft;

    @Column("house_risks")
    @Comment("房屋隐患")
    @ApiModelProperty(description = "房屋隐患")
    @ColDefine(type = ColType.VARCHAR, width = 300)
    private String houseRisks;

    @Column("town_street")
    @Comment("乡街")
    @ApiModelProperty(description = "乡街")
    @ColDefine(type = ColType.VARCHAR, width = 300)
    private String townStreet;

    @Column("village")
    @Comment("村居")
    @ApiModelProperty(description = "村居")
    @ColDefine(type = ColType.VARCHAR, width = 300)
    private String village;

    @Column("detail_address")
    @Comment("详细地址")
    @ApiModelProperty(description = "详细地址")
    @ColDefine(type = ColType.VARCHAR, width = 300)
    private String detailAddress;

    @Column("param_data")
    @Comment("额外参数")
    @ApiModelProperty(description = "额外参数")
    @ColDefine(type = ColType.PSQL_JSON, width = 300)
    private JSONObject paramData;

    @Column("is_fill")
    @Comment("是否已采集")
    @ApiModelProperty(description = "是否已采集")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String isFill;

    @Column("fill_date")
    @Comment("数据采集时间")
    @ApiModelProperty(description = "数据采集时间")
    @ColDefine(type = ColType.DATETIME, width = 50)
    private LocalDateTime fillDate;

    @Column("create_by")
    @Comment("提交人")
    @ApiModelProperty(description = "提交人")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String createBy;

    @Column("create_time")
    @Comment("提交时间")
    @ApiModelProperty(description = "提交时间")
    @ColDefine(type = ColType.DATETIME, width = 50)
    private LocalDateTime createTime;

    @Column("update_id")
    @Comment("修改人")
    @ApiModelProperty(description = "修改人")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String updateId;

    @Column("update_time")
    @Comment("修改时间")
    @ApiModelProperty(description = "修改时间")
    @ColDefine(type = ColType.DATETIME, width = 50)
    private LocalDateTime updateTime;

    @Column("delete_reason")
    @Comment("删除原因")
    @ApiModelProperty(description = "删除原因")
    @ColDefine(type = ColType.VARCHAR, width = 300)
    private String deleteReason;

    @Column("deleted")
    @Comment("是否删除")
    @ApiModelProperty(description = "是否删除")
    @ColDefine(type = ColType.BOOLEAN, width = 50)
    private boolean deleted;

    @Column("house_relat_peoples")
    @Comment("房屋关联人的信息")
    @ApiModelProperty(description = "房屋关联人的信息")
    @ColDefine(type = ColType.VARCHAR, width = 600)
    private List<HouseRelatPerson> houseRelatPeoples;

    @Column("longitude")
    @Comment("经度")
    @ApiModelProperty(description = "经度")
    @ColDefine(type = ColType.VARCHAR, width = 100)
    private String longitude;

    @Column("latitude")
    @Comment("纬度")
    @ApiModelProperty(description = "纬度")
    @ColDefine(type = ColType.VARCHAR, width = 100)
    private String latitude;

    @ApiModelProperty(description = "楼栋数据")
    private BuildingInfo buildingInfo;
}
